<%
# Copyright (C) 2015 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<noscript>
  <div role="alert" class="ic-flash-static ic-flash-error">
    <div class="ic-flash__icon" aria-hidden="true">
      <i class="icon-warning"></i>
    </div>
    <h1><%= t :javascript_required, "You need to have JavaScript enabled in order to access this site." %></h1>
  </div>
</noscript>

<% unless params[:previewing_from_themeeditor] || !session.has_key?(:brand_config_md5) %>
  <div role="alert" class="ic-flash-static ic-flash-info ic-flash--Theme-Editor">
    <% if params[:editing_brand_config] %>
      {{#t}}You're editing your Canvas Theme! The changes have not been applied yet.{{/t}}
    <% else %>
      <% current_account = ::Context.get_account(@context) || @domain_root_account %>
      <%= t do %>
        You're editing your Canvas Theme! Apply or cancel changes from within the
        <%= link_to "Theme Editor", account_theme_editor_path(current_account), target: "_top" %>.
      <% end %>
      <% if current_account.settings[:sub_account_includes] %>
        <br />
        <%= t "Note: sub-account themes are not active during this preview. " %>
      <% end %>
    <% end %>
  </div>
<% end %>

<% if @current_user.try(:show_bouncing_channel_message?) %>
  <div role="alert" class="ic-flash-static ic-flash-warning">
    <div class="ic-flash__icon" aria-hidden="true">
      <i class="icon-warning"></i>
    </div>
    <%= t(:bouncing_communication_channels, "There appears to be a problem with one of your contact methods. Please check your *Settings Page*.", wrapper: link_to('\1', settings_profile_path)) %>
  </div>
<% end %>
